﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="JT_BoardManager.aspx.cs" Inherits="JTicket.UI.JT_BoardManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <!--分页Script-->
    <script type="text/jscript">
        function pageselectCallback(page_id, jq) {
            var keyWord = $("#KeyWord").attr("value");
            window.location.href = "JT_BoardManager.aspx?KeyWord=" 
            + keyWord + "&page=" + page_id;
        }
        $(document).ready(function () {
            $("#pager").pagination(pages, {
                current_page: page,
                items_per_page: 1,
                first_text: "首页",
                prev_text: "上一页",
                next_text: "下一页",
                last_text: "尾页",
                ellipse_text: " ",
                callback: pageselectCallback
            });
        });
        //查询
        function IsSelect() {
            window.location.href = "JT_BoardManager.aspx?KeyWord=" 
            + $("#KeyWord").attr("value") + "&page=0";
        }
        //删除
        function IsDels(Ids) {
            if (isdel()) {
                $.ajax({
                    type: "get",
                    url: "BoardHandler.axd?IdList=" + Ids,
                    success: function (msg) {
                        window.location.reload(); //重新加载该页面
                    },
                    error: function () { isAlertError(); }
                });
            }
        }
        //批量删除
        function IsExc() {
            if (isdel()) {
                if (CheckValue() != "") {
                    $.ajax({
                        type: "get",
                        url: "BoardHandler.axd?IdList=" + CheckValue(),
                        success: function (msg) {
                            window.location.reload(); //重新加载该页面
                        },
                        error: function () { isAlertError(); }
                    });
                }
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table align="center" border="0" cellpadding="4" cellspacing="1" class="toptable grid"
        width="100%">
        <tr>
            <td class="category t2" height="25" width="100">
                公告管理
            </td>
            <td class="category" height="25">
                <input id="KeyWord" class="input" type="text" /><input type="button" id="BtnSelete" value="查  询" onclick="IsSelect();" onmousemove="showBtnOver(this)"
                    onmouseout="showBtnOut(this)" class="submitMiniGreen" /><input type="button" id="BtnAdd" value="添  加"
                 onclick="javascript:window.location.href ='JT_BoardAdd.aspx?Flag=Add'"
                    onmousemove="showBtnOver(this)" onmouseout="showBtnOut(this)" class="submitMiniGreen" />
            </td>
        </tr>
    </table>
    <table cellpadding="1" cellspacing="1" id="TbInfo" class="TbInfo">
        <tr>
            <td class="B" style="width: 30px">
                选择
            </td>
            <td class="B" style="width: 300px">
                标题
            </td>
            <td class="B" style="width: 500px">
                内容
            </td>
            <td class="B" style="width: 100px">
                日期
            </td>
            <td class="B" style="width: 100px">
                时间
            </td>
            <td class="B" style="width: 60px">
                操作
            </td>
        </tr>
        <%if(_boardInfo.Count>0){ %>
        <%foreach (var Board in _boardInfo)
          { %>
        <tr>
            <td class="td1">
                <input   name="cb"  class="checkbox" type="checkbox"  value="<%=Board.id%>" style="border: 0"  />
            </td>
            <td class="td1">
                <%=Board.sTitle%>
            </td>
            <td class="td1">
                <%=JTicket.Common.StringHelp.CutString(Board.sContent,30)%>
            </td>
            <td class="td1">
                <%=Board.sdate%>
            </td>
            <td class="td1">
                <%=Board.Stime%>
            </td>
            <td class="td2">
                <img src="Images/icon_edit.gif" alt="编辑" style="cursor: hand" onclick="isEdite('JT_BoardAdd.aspx?Flag=Edite&ID=<%=Board.id%>')" />&nbsp;&nbsp;
             <img src="Images/no.gif" alt="删除" style="cursor: hand"  onclick="javascript:IsDels('<%=Board.id%>');"/>
            </td>
        </tr><%}%>
        <%}%>
    </table>
    <div id="pager" class="pagination" style="background: #FFFFFF">
    </div>
    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
        <tr bgcolor="#E7E7E7">
            <td align="center" bgcolor="#E7E7E7" style="color: #000000" colspan="4">
                <input id="chkall" type="checkbox" onclick="CheckAll(this.form)" style="border: 0" />全选<asp:DropDownList
                    ID="DropDownList1" runat="server">
                    <asp:ListItem Value="1">---删除所选---</asp:ListItem>
                </asp:DropDownList>
                <input type="button"  id="Button1" value="执行操作" onclick="return IsExc()" 
                    onmousemove="showBtnOver(this)" onmouseout="showBtnOut(this)" class="submitMiniGreen"/>
            </td>
        </tr>
    </table>
</asp:Content>
